package cn.kgc.controller;


import cn.kgc.pojo.Position;

import cn.kgc.service.PositionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author 陈俊良
 * @version 1.0
 * @date 2022/10/10 - 16:04
 */
@Controller
public class PositionController {
    @Autowired
    private PositionService positionService;

    //查询所有
    @RequestMapping("/positionList")
    @ResponseBody
    public Object positionList() {

        Map<String, Object> maps = new HashMap<>();

        List<Position> positionList = positionService.findPositionList();
        maps.put("data", positionList);
        return maps;


    }
}